//
//  Login_SendTableViewCell.m
//  HappyRent
//
//  Created by CoderYee on 2017/3/31.
//  Copyright © 2017年 内圈科技. All rights reserved.
//

#import "Login_SendTableViewCell.h"

@implementation Login_SendTableViewCell

-(void)addOwnView{
    
    [super addOwnView];
    
//    [self.imageView setImage:[UIImage imageNamed:@"icon_yanzhengma"]];
    _textField=[[UITextField alloc] init];
    _textField.placeholder=@"请输入验证码";
    _textField.font=systemfont(14);
    [self.contentView addSubview:_textField];
    [_textField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.contentView).offset(15);
        make.right.equalTo(self.contentView).with.offset(-90);
    }];
    
    _sendMessageButton=[UIButton buttonWithType:UIButtonTypeCustom];
    [_sendMessageButton setTitle:@"获取验证码" forState:UIControlStateNormal];
    _sendMessageButton.titleLabel.font=systemfont(13);
    [_sendMessageButton setTitleColor:kGrayColor forState:UIControlStateNormal];
    [_sendMessageButton addTarget:self action:@selector(clicksendButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:_sendMessageButton];
    [_sendMessageButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.right.equalTo(self.contentView).with.offset(-5);
        make.width.mas_offset(70);
    }];
    
    UIView  *lineView=[[UIView alloc] init];
    lineView.alpha=0.3;
    [lineView setBackgroundColor:kGrayColor];
    [self.contentView addSubview:lineView];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.equalTo(self.contentView);
        make.width.mas_equalTo(1);
        make.right.equalTo(self.contentView).with.offset(-90);
    }];

}
-(void)clicksendButton:(UIButton *)sender
{
    //发送验证码事件
    if (self.delegate&&[self.delegate respondsToSelector:@selector(clickTableView:withtouchView:EventType:)]) {
        [self.delegate clickTableView:self withtouchView: sender EventType:TableClickEventValue1];
    }
    
}
@end
